Class ActivityFileImpl

All Implemented Interfaces:
IPCObject, ActivityFile, NetworkFile

public class ActivityFileImpl extends NetworkFileImpl implements ActivityFile
Information provided by the PKI file:

    \class ActivityFile
    
    \brief ActivityFile extends from NetworkFile. It adds the activity layer to the file.
    
    \example appWindow().getActiveFile()
    
Author:
Auto-generated
  • Constructor Details

  • Method Details

    • getInstruction

      public String getInstruction(int index)
      Information provided by the PKI file:
      
          \brief Returns the evaluated instructions at the specified index.
          
          \param index, the instruction page index.  -1 returns the current page.
          
          \return QString, the evaluated instructions at the specified index.
          
              
      Specified by:
      getInstruction in interface ActivityFile
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • getInstructionSource

      public String getInstructionSource(int index)
      Information provided by the PKI file:
      
          \brief Returns the instruction source at the specified index.
          
          \param index, the instruction page index.
          
          \return QString, the instruction source at the specified index.
          
              
      Specified by:
      getInstructionSource in interface ActivityFile
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • getCurrentInstructionSource

      public String getCurrentInstructionSource()
      Information provided by the PKI file:
      
          \brief Returns the current intruction source.
          
          \return QString, the current intruction source.
          
              
      Specified by:
      getCurrentInstructionSource in interface ActivityFile
      Returns:
      String Returns a String
    • getCurrentInstruction

      public String getCurrentInstruction()
      Information provided by the PKI file:
      
          \brief Returns the current evaluated instructions.
          
          \return QString, the current evaluated instructions.
          
              
      Specified by:
      getCurrentInstruction in interface ActivityFile
      Returns:
      String Returns a String
    • getInstructionCount

      public int getInstructionCount()
      Information provided by the PKI file:
      
          \brief Returns the number of instruction pages.
          
          \return int, the number of instruction pages.
          
              
      Specified by:
      getInstructionCount in interface ActivityFile
      Returns:
      int Returns a int
    • resetActivity

      public void resetActivity()
      Information provided by the PKI file:
      
          \brief Resets the activity.
          
              
      Specified by:
      resetActivity in interface ActivityFile
    • getPercentageComplete

      public double getPercentageComplete()
      Information provided by the PKI file:
      
          \brief Returns the percentage complete.
          
          \return double, the percentage complete.
          
              
      Specified by:
      getPercentageComplete in interface ActivityFile
      Returns:
      double Returns a double
    • getAssessmentItemsCount

      public double getAssessmentItemsCount()
      Information provided by the PKI file:
      
          \brief Returns the total number of assessment items.
          
          \return double, the total number of assessment items.
          
              
      Specified by:
      getAssessmentItemsCount in interface ActivityFile
      Returns:
      double Returns a double
    • getCorrectAssessmentItemsCount

      public double getCorrectAssessmentItemsCount()
      Information provided by the PKI file:
      
          \brief Returns the number of correct assessment items.
          
          \return double, the number of correct assessment items.
          
              
      Specified by:
      getCorrectAssessmentItemsCount in interface ActivityFile
      Returns:
      double Returns a double
    • getAssessmentScoreCount

      public double getAssessmentScoreCount()
      Information provided by the PKI file:
      
          \brief Returns the total number of assessment scores.
          
          \return double, the total number of assessment scores.
          
              
      Specified by:
      getAssessmentScoreCount in interface ActivityFile
      Returns:
      double Returns a double
    • getCorrectAssessmentScoreCount

      public double getCorrectAssessmentScoreCount()
      Information provided by the PKI file:
      
          \brief Returns the number of correct assessment scores.
          
          \return double, the number of correct assessment scores.
          
              
      Specified by:
      getCorrectAssessmentScoreCount in interface ActivityFile
      Returns:
      double Returns a double
    • runConnectivityTests

      public void runConnectivityTests()
      Information provided by the PKI file:
      
          \brief Runs the connectivity tests.
          
          \remark Use getLastConnectivityTestResultAt() and getLastConnectivityTestCorrectCount() to get results afterwards.
          
              
      Specified by:
      runConnectivityTests in interface ActivityFile
    • getConnectivityCount

      public double getConnectivityCount()
      Information provided by the PKI file:
      
          \brief Returns the total number of connectivity tests.
          
          \return double, the the total number of connectivity tests.
          
              
      Specified by:
      getConnectivityCount in interface ActivityFile
      Returns:
      double Returns a double
    • getLastConnectivityTestResultAt

      public String getLastConnectivityTestResultAt(int index)
      Information provided by the PKI file:
      
          \brief Returns the connectivity test result of the last run at index.
          
          \remark     Valid strings are:
          - "Correct" - correct
          - "Incorrect" - incorrect
          - "Do Not Test" - the connectivity test is not configured to be tested
          - "" - the connectivity test has not been ran yet
          
          \return QString, the connectivity test result at index.
          
              
      Specified by:
      getLastConnectivityTestResultAt in interface ActivityFile
      Parameters:
      index - Takes in a parameter of index
      Returns:
      String Returns a String
    • getLastConnectivityTestCorrectCount

      public int getLastConnectivityTestCorrectCount()
      Information provided by the PKI file:
      
          \brief Returns the number of correct connectivity tests at the last run.
          
          \return int, the number of correct connectivity tests at the last run.
          
              
      Specified by:
      getLastConnectivityTestCorrectCount in interface ActivityFile
      Returns:
      int Returns a int
    • getComparatorTree

      public TreeNode getComparatorTree()
      Information provided by the PKI file:
      
          \brief Returns a structure representing users progress towards the completion of this activity.
          \param refresh - refresh results obtained from the most recent call to this method.
          \param format - defines string representation for the information: "json", "xml", etc.
          \return int, the number of correct connectivity tests at the last run.
          
          \NOT PORTED TO PT DESKTOP
          QString getActivityProgressInfo(bool refresh, QString format) - PrivActivityWizard;
          
          \brief Returns the assessment item tree.
          
          \remark This tree defines what assessment items can be and what
          is currently being assessed by this activity.
          
          \return TreeNode, the assessment item tree.
          
              
      Specified by:
      getComparatorTree in interface ActivityFile
      Returns:
      TreeNode Returns a TreeNode
    • getAssessedComparatorTree

      public TreeNode getAssessedComparatorTree()
      Information provided by the PKI file:
      
          \brief Returns the item's assessed assessment item tree.
          
          \remark This tree is compared.
          
          \return TreeNode, the item's assessed assessment item tree.
          
              
      Specified by:
      getAssessedComparatorTree in interface ActivityFile
      Returns:
      TreeNode Returns a TreeNode
    • getLastAssessedComparatorTree

      public TreeNode getLastAssessedComparatorTree()
      Information provided by the PKI file:
      
          \brief Returns the item's last assessed assessment item tree.
          
          \remark This tree is compared.
          
          \return TreeNode, the item's last assessed assessment item tree.
          
              
      Specified by:
      getLastAssessedComparatorTree in interface ActivityFile
      Returns:
      TreeNode Returns a TreeNode
    • nextInstructionPage

      public String nextInstructionPage()
      Information provided by the PKI file:
      
          \brief Go to the next instruction page and returns the evaluated instruction.
          
          \return QString, the evaluated instructions the next page.
          
              
      Specified by:
      nextInstructionPage in interface ActivityFile
      Returns:
      String Returns a String
    • prevInstructionPage

      public String prevInstructionPage()
      Information provided by the PKI file:
      
          \brief Go to the previous instruction page and returns the evaluated instruction.
          
          \return QString, the evaluated instructions the previous page.
          
              
      Specified by:
      prevInstructionPage in interface ActivityFile
      Returns:
      String Returns a String
    • removeInstructionPage

      public String removeInstructionPage()
      Information provided by the PKI file:
      
          \brief Remove the current instruction page and returns the evaluated instruction.
          
          \return QString, the evaluated instructions on the page after the removal.
          
              
      Specified by:
      removeInstructionPage in interface ActivityFile
      Returns:
      String Returns a String
    • insertInstructionPage

      public String insertInstructionPage()
      Information provided by the PKI file:
      
          \brief Insert an instruction page and returns the current page evaluated instruction.
          
          \return QString, the evaluated instructions on the current page.
          
              
      Specified by:
      insertInstructionPage in interface ActivityFile
      Returns:
      String Returns a String
    • getLockingTree

      public LockingTree getLockingTree()
      Information provided by the PKI file:
      
          \brief Returns the locking tree.
          
          \return LockingTree, the locking tree.
          
              
      Specified by:
      getLockingTree in interface ActivityFile
      Returns:
      LockingTree Returns a LockingTree
    • getInitNetworkFile

      public NetworkFile getInitNetworkFile()
      Information provided by the PKI file:
      
          \brief Returns the initial network file.
          
          \remark     The initial network file is the starting network file.
          It is used to replace the user network on a new activity
          or when the user resets the activity.
          
          \return NetworkFile, the initial network file.
          
              
      Specified by:
      getInitNetworkFile in interface ActivityFile
      Returns:
      NetworkFile Returns a NetworkFile
    • getAnsNetworkFile

      public NetworkFile getAnsNetworkFile()
      Information provided by the PKI file:
      
          \brief Returns the answer network file.
          
          \remark The answer network file is used to compare against the user network.
          
          \return NetworkFile, the answer network file.
          
              
      Specified by:
      getAnsNetworkFile in interface ActivityFile
      Returns:
      NetworkFile Returns a NetworkFile
    • getUserNetworkFile

      public NetworkFile getUserNetworkFile()
      Information provided by the PKI file:
      
          \brief Returns the user network file.
          
          \remark The user network file is the network file that the user works
          with during an activity.
          
          \return NetworkFile, the user network file.
          
              
      Specified by:
      getUserNetworkFile in interface ActivityFile
      Returns:
      NetworkFile Returns a NetworkFile
    • getVarNetworkFile

      public NetworkFile getVarNetworkFile()
      Information provided by the PKI file:
      
          \brief Returns the var network file.
          
          \return NetworkFile, the var network file.
          
              
      Specified by:
      getVarNetworkFile in interface ActivityFile
      Returns:
      NetworkFile Returns a NetworkFile
    • getCurrentNetworkFile

      public NetworkFile getCurrentNetworkFile()
      Information provided by the PKI file:
      
          \brief Returns the current network file in activity wizard, which can be the init, answer, or user network file.
          
          \return NetworkFile, the current network file.
          
              
      Specified by:
      getCurrentNetworkFile in interface ActivityFile
      Returns:
      NetworkFile Returns a NetworkFile
    • getHashedPassword

      public String getHashedPassword()
      Information provided by the PKI file:
      
          \brief Returns the MD5 hash of the activity password.
          
          \return QString, the MD5 hash of the activity password.
          
              
      Specified by:
      getHashedPassword in interface ActivityFile
      Returns:
      String Returns a String
    • getComponentList

      public List<String> getComponentList()
      Information provided by the PKI file:
      
          \brief Returns the list of components.
          
          \return vector<QString>, the list of components.
          
              
      Specified by:
      getComponentList in interface ActivityFile
      Returns:
      List<String> Returns a List<String>
    • setCountDownTime

      public void setCountDownTime(int ms)
      Information provided by the PKI file:
      
          \brief Sets the countdown time.
          
          \param ms, countdown time in milliseconds.
          
              
      Specified by:
      setCountDownTime in interface ActivityFile
      Parameters:
      ms - Takes in a parameter of ms
    • getCountDownTime

      public int getCountDownTime()
      Information provided by the PKI file:
      
          \brief Returns the total countdown time in milliseconds.
          
          \return int, the total countdown time in milliseconds.
          
              
      Specified by:
      getCountDownTime in interface ActivityFile
      Returns:
      int Returns a int
    • getCountDownTimeLeft

      public int getCountDownTimeLeft()
      Information provided by the PKI file:
      
          \brief Returns the countdown time left in milliseconds.
          
          \return int, countdown time left in milliseconds.
          
              
      Specified by:
      getCountDownTimeLeft in interface ActivityFile
      Returns:
      int Returns a int
    • setTimerType

      public void setTimerType(ACTIVITYTIMERTYPE e)
      Information provided by the PKI file:
      
          \brief Sets the timer type.
          
          \param e,   the type of timer.
          Timer types:        ELAPSED = 0,
          COUNTDOWN = 1,
          NONE = 2
          
              
      Specified by:
      setTimerType in interface ActivityFile
      Parameters:
      e - Takes in a parameter of e
    • getTimerType

      public ACTIVITYTIMERTYPE getTimerType()
      Information provided by the PKI file:
      
          \brief Returns the current timer type.
          
          \return TIMER_TYPE, the current timer type.
          Timer types:        ELAPSED = 0,
          COUNTDOWN = 1,
          NONE = 2
          
              
      Specified by:
      getTimerType in interface ActivityFile
      Returns:
      ACTIVITYTIMERTYPE Returns a ACTIVITYTIMERTYPE
    • getDynamicPercentageFeedbackType

      public DYNAMICTYPE getDynamicPercentageFeedbackType()
      Information provided by the PKI file:
      
          \brief Returns the dynamic feedback type.
          
          \return DYNAMICTYPE, the dynamic feedback type.
          Dynamic feedback types:     NOFEEDBACK = 0,
          PERCENTAGEPOINT = 1,
          PERCENTAGESCORE = 2,
          POINTS = 3,
          SCORE = 4
          
              
      Specified by:
      getDynamicPercentageFeedbackType in interface ActivityFile
      Returns:
      DYNAMICTYPE Returns a DYNAMICTYPE
    • setDynamicPF

      public void setDynamicPF(boolean enable)
      Information provided by the PKI file:
      
          \brief Sets the dynamic feedback to be enabled or disabled.
          
          \param enable, true enables dynamic percentage feedback, false disables it.
          
              
      Specified by:
      setDynamicPF in interface ActivityFile
      Parameters:
      enable - Takes in a parameter of enable
    • isDynamicPercentageFeedback

      public boolean isDynamicPercentageFeedback()
      Information provided by the PKI file:
      
          \brief Returns the state of the dynamic feedback.
          
          \return bool, true if dynamic percentage feedback is enabled, otherwise false.
          
              
      Specified by:
      isDynamicPercentageFeedback in interface ActivityFile
      Returns:
      boolean Returns a boolean
    • getVariableManager

      public VariableManager getVariableManager()
      Information provided by the PKI file:
      
          \brief Returns the Variable Manager.
          
          \return VariableManager, the Variable Manager.
          
              
      Specified by:
      getVariableManager in interface ActivityFile
      Returns:
      VariableManager Returns a VariableManager
    • getDyFeedbackString

      public String getDyFeedbackString()
      Information provided by the PKI file:
      
          \brief Returns the dynamic feedback percentage points, percentage score, points, or score.
          
          \return QString, the dynamic feedback if the type is not set to NOFEEDBACK, otherwise an empty string.
          
              
      Specified by:
      getDyFeedbackString in interface ActivityFile
      Returns:
      String Returns a String
    • getPercentageCompleteScore

      public double getPercentageCompleteScore()
      Information provided by the PKI file:
      
          \brief Returns the percentage complete score.
          
          \return double, the percentage complete score.
          
              
      Specified by:
      getPercentageCompleteScore in interface ActivityFile
      Returns:
      double Returns a double
    • isUserProfileLocked

      public boolean isUserProfileLocked()
      Information provided by the PKI file:
      
          \brief Returns whether this activity file is profile locked or not
          
          
          \return bool, true if the user profile is locked and false if not.
          
              
      Specified by:
      isUserProfileLocked in interface ActivityFile
      Returns:
      boolean Returns a boolean
    • setCompletedFeedback

      public void setCompletedFeedback(String str)
      Information provided by the PKI file:
      
          \brief Sets the text shown on activity completion to be the given text.
          
          \param str, the text to use for activity completion message.
          
              
      Specified by:
      setCompletedFeedback in interface ActivityFile
      Parameters:
      str - Takes in a parameter of str
    • getCompletedFeedback

      public String getCompletedFeedback()
      Information provided by the PKI file:
      
          \brief Returns the activity completion feedback text.
          
          \return QString, the activity completion feedback text.
          
              
      Specified by:
      getCompletedFeedback in interface ActivityFile
      Returns:
      String Returns a String
    • setInCompleteFeedback

      public void setInCompleteFeedback(String str)
      Information provided by the PKI file:
      
          \brief Sets the text shown on activity is not yet completed.
          
          \param str, the text to use for activity incomplete message.
          
              
      Specified by:
      setInCompleteFeedback in interface ActivityFile
      Parameters:
      str - Takes in a parameter of str
    • getIncompleteFeedback

      public String getIncompleteFeedback()
      Information provided by the PKI file:
      
          \brief Returns the activity incomplete feedback text.
          
          \return QString, the activity incomplete completion feedback text.
          
              
      Specified by:
      getIncompleteFeedback in interface ActivityFile
      Returns:
      String Returns a String
    • getTimeElapsed

      public int getTimeElapsed()
      Information provided by the PKI file:
      
          \brief Returns the activity run time.
          
          \return int, how long the activity has been running, in milliseconds.
          
              
      Specified by:
      getTimeElapsed in interface ActivityFile
      Returns:
      int Returns a int
    • setTimeElapsed

      public void setTimeElapsed(int ms)
      Information provided by the PKI file:
      
          \brief Sets the activity current run time.
          
          \param ms, runtime time in milliseconds.
          
              
      Specified by:
      setTimeElapsed in interface ActivityFile
      Parameters:
      ms - Takes in a parameter of ms
    • getChallengeKeyAsInts

      public List<Integer> getChallengeKeyAsInts()
      Information provided by the PKI file:
      
          \brief Get the challenge key for the password
          
              
      Specified by:
      getChallengeKeyAsInts in interface ActivityFile
      Returns:
      List<Integer> Returns a List<Integer>
    • getChallengeKeyAsBase64

      public String getChallengeKeyAsBase64()
      Information provided by the PKI file:
      
          \brief Get the challenge key for the password
          
              
      Specified by:
      getChallengeKeyAsBase64 in interface ActivityFile
      Returns:
      String Returns a String
    • confirmPassword

      public boolean confirmPassword(String hashedPass)
      Information provided by the PKI file:
      
          \brief Confirm the password, only then will IPC work
          
              
      Specified by:
      confirmPassword in interface ActivityFile
      Parameters:
      hashedPass - Takes in a parameter of hashedPass
      Returns:
      boolean Returns a boolean
    • isPasswordConfirmed

      public boolean isPasswordConfirmed()
      Information provided by the PKI file:
      
          \brief Check if password is confirmed
          
              
      Specified by:
      isPasswordConfirmed in interface ActivityFile
      Returns:
      boolean Returns a boolean
    • getCertInfo

      public String getCertInfo()
      Specified by:
      getCertInfo in interface ActivityFile
      Returns:
      String Returns a String
    • isActivityFile

      public boolean isActivityFile()
      Information provided by the PKI file:
      
          \brief Returns whether this file is an activity file or regular network file
          
              
      Specified by:
      isActivityFile in interface ActivityFile
      Specified by:
      isActivityFile in interface NetworkFile
      Overrides:
      isActivityFile in class NetworkFileImpl
      Returns:
      boolean Returns a boolean